<?php
class Mod_menu extends CI_Controller{
    private $menu ='';
    private $mIdcat1 = array();
    private $mIdcat2 = array();
    private $mIdcat3 = array();
    function  __construct(){
        parent::__construct();
    }
    function index(){
       
    }
    function top_nav()
    {
       $catpro1 = $this->common_model->getdata('article_category',array('publish'=>1,'parentid'=>0),'',array('order','ASC'));
       if(!empty($catpro1)){
            foreach ($catpro1 as $p1){
                $pcat1[$p1->parentid][]=$p1;   
            }
        }
        foreach ($pcat1[0] as $pp1){ 
            $mIdcat1[]=$pp1->id;
            if(!empty($pcat1[$pp1->id])){
                foreach( $pcat1[$pp1->id] as $vvv1){
                    $mIdcat2[]=$vvv1->id;
                }
            }
            $mCat[$pp1->id]= $this->common_model->getdata('article_category',array('parentid'=>$pp1->id),'',array('order','ASC'));
            $mIdcat1 = null;
            $mIdcat2 = null;
        }
     $this->load->view('mod_menu/top_nav',array('cat'=>$mCat,'cat1'=>$pcat1[0]));
    }
    function object_nav()
    {
       $catpro1 = $this->common_model->getdata('subjects',array('publish'=>1,'parentid'=>0),'',array('order','ASC'));
       if(!empty($catpro1)){
            foreach ($catpro1 as $p1){
                $pcat1[$p1->parentid][]=$p1;   
            }
        }
        foreach ($pcat1[0] as $pp1){ 
            $mIdcat1[]=$pp1->id;
            if(!empty($pcat1[$pp1->id])){
                foreach( $pcat1[$pp1->id] as $vvv1){
                    $mIdcat2[]=$vvv1->id;
                }
            }
            $mCat[$pp1->id]= $this->common_model->getdata('subjects',array('parentid'=>$pp1->id),'',array('order','ASC'));
            $mIdcat1 = null;
            $mIdcat2 = null;
        }
     return $this->load->view('mod_menu/subjects_nav',array('cat'=>$mCat,'cat1'=>$pcat1[0]),true);
    }
}